This port is a connection point for a control link.
An output control port is ordinarily quiescent. When “poked” by a box it is on, however, it emits an infinitesimally short control “pulse” that can be transmitted instantaneously to other (input) control ports via a control link.
An input control port “listens” for control pulses and notifies the box it is on that such a pulse has been received. It acts exactly like a flip-flop whose value is set to “one” by a received control pulse, and whose value is reset to “zero” by the box it is on. The action of the box in response to a pulse on a particular input control port depends on its function, of course.
61
This is a primitive part in the “Concurrent” interpretation.
633
This port is a connection point for a data link.
An output data port is ordinarily quiescent. When “written to” by a box it is on, however, it emits for an infinitesimally short time a data value that can be transmitted instantaneously to other (input) data ports via a data link.
An input data port “listens” for data values and remembers the data value when it receives one. It acts exactly like a register whose value is set whenever a data value is received. (The new value overwrites any previous value that may have been in this register.) The box it is on may “read” the data value from any input data port at any time.
61
This is a primitive part in the “Concurrent” interpretation.
166
This link transmits a control “pulse” instantaneously from any output control port connected to its left end, to every input control port connected to its right end.
61
This is a primitive part in the “Concurrent” interpretation.
155
This link transmits a data value instantaneously from any output data port connected to its left end, to every input data port connected to its right end.
61
This is a primitive part in the “Concurrent” interpretation.
107
When “start” is poked, values are read from “x” and “y”, their sum is written to “z”, and “done” is poked.
60
start:
{
write (z, read (x) + read (y));
poke (done);
}
0
120
When “start” is poked, values are read from “x” and “y”, their difference (x-y) is written to “z”, and “done” is poked.
60
start:
{
write (z, read (x) - read (y));
poke (done);
}
0
111
When “start” is poked, values are read from “x” and “y”, their product is written to “z”, and “done” is poked.
60
start:
{
write (z, read (x) * read (y));
poke (done);
}
0
291
Initially, the state of this box is such that it thinks none of the control links attached to “ready” has been poked yet.
Exactly when all control links attached to “ready” have been poked at least once, “synchronized” is poked, and the state of this box is reset to its initial condition.
576
boolean *poked;
int number_poked;
int number_needed = size (ready);
/*------------------------------------*/
void reset ()
{
int i;
for (i = number_needed - 1; i >= 0; i--) poked [i] = FALSE;
When “start” is poked, the value of this box’s instance information is written to “z”, and “done” is poked.
64
start:
{
write (z, instance_information ());
poke (done);
}
0
302
Initially, the value of this box’s instance information is written to “z” and “done” is poked.
When “start” is poked, the value is read from “x” and compared to the last value written to “z”. If and only if they are different, the new value just read from “x” is written to “z”, and “done” is poked.
423
real last_value;
/*------------------------------------*/
void write_value ()
{
write (z, last_value);
poke (done);
}
/*------------------------------------*/
init:
{
last_value = instance_information;
write_value ();
}
/*------------------------------------*/
start:
{
real new_value;
new_value = read (x);
if (new_value != last_value)
{
last_value = new_value;
write_value ();
}
}
0
91
When “pass” is poked, a value is read from “x”, it is written to “z”, and “done” is poked.
48
pass:
{
write (z, read (x));
poke (done);
}
0
193
• When “pass1” is poked, the value of “x” is read, it is written to “z1”, and “done1” is poked.
• When “pass2” is poked, the value of “x” is read, it is written to “z2”, and “done2” is poked.
145
pass1:
{
write (z1, read (x));
poke (done1);
}
/*------------------------------------*/
pass2:
{
write (z2, read (x));
poke (done2);
}
0
191
• When “pass1” is poked, the value of “x1” is read, it is written to “z”, and “done” is poked.
• When “pass2” is poked, the value of “x2” is read, it is written to “z”, and “done” is poked.
143
pass1:
{
write (z, read (x1));
poke (done);
}
/*------------------------------------*/
pass2:
{
write (z, read (x2));
poke (done);
}
0
105
When “start” is poked, this box reads “delay” and waits that number of clock ticks before poking “done”.
49
start:
{
hold (read (delay));
poke (done);
}
0
136
When “start” is poked:
• If “x” > 0 then “positive” is poked.
• If “x” = 0 then “zero” is poked.
• If “x” < 0 then “negative” is poked.
133
start:
{
real xx;
xx = read (x);
if (xx > 0) poke (positive);
else if (xx == 0) poke (zero);
else poke (negative);
}
0
168
When “start” is poked, a value obtained from an A/D converter (whose identity is in the instance information for this box) is written to “sample”, and “done” is poked.
78
start:
{
write (sample, A_to_D (instance_information ()));
poke (done);
}
0
167
When “start” is poked, a value is read from “data” and is output to a D/A converter (whose identity is in the instance information for this box), and “done” is poked.
75
start:
{
D_to_A (instance_information (), read (data));
poke (done);
}
0
208
When “on” is poked, a physical switch (whose identity is given by the instance information of this box) is turned on, and “done” is poked. When “off” is poked, the switch is turned off, and “done” is poked.
183
on:
{
set_switch (instance_information (), TRUE);
poke (done);
}
/*------------------------------------*/
off:
{
set_switch (instance_information (), FALSE);
poke (done);
}
0
86
Upon completion of system initialization, “go” is poked. This box does nothing else.
23
init:
{
poke (go);
}
0
107
When “start” is poked, a value is read from “x”, its negation (-x) is written to “z”, and “done” is poked.
50
start:
{
write (z, -read (x));
poke (done);
}
0
114
When “start” is poked, a value is read from “x”, its absolute value (|x|) is written to “z”, and “done” is poked.
101
start:
{
real abs;
abs = read (x);
if (abs < 0) abs = -abs;
write (z, abs);
poke (done);
}
0
180
When “start” is poked, values are read from “x” and “max”. Then one of the following values is written to “z”:
• if x < max, then x
• if x ≥ max, then max
and “done” is poked.
181
start:
{
real input, high, output;
input = read (x);
high = read (max);
if (input > high) then output = high;
else output = input;
write (z, output);
poke (done);
}
0
395
A “Pin” acts just like an electrical terminal, in that it is the connector on an analog element (a box) to which a “Wire” can be attached.
If it is an input “Pin”, a “Wire” connected to it delivers a real-valued signal at every instant in time. If it is an output “Pin”, a “Wire” connected to it broadcasts the real-valued signal on the “Pin” to every input “Pin” that “Wire” is connected to.
0
298
A “Wire” acts just like an electrical wire (network), in that it is the thing that connects together the pins on analog elements (boxes).
A “Wire” connected to an output “Pin” delivers a real-valued signal produced by that “Pin”, at every instant in time, to every input “Pin” it is connected to.
8
0
3
3
0
2
11
3
1
2
14
4
0
1
3
4
1
0
1
5
0
2
2
5
1
2
7
6
0
1
1
6
1
1
2
11
16
4
3
1
0
13
0
1
1
13
16
2
0
1
4
1
0
13
22
1
1
13
38
2
0
1
5
4
0
11
0
1
1
11
9
3
2
7
9
3
3
7
19
3
4
11
19
2
0
1
2
1
2
3
3
4
6
4
0
15
19
1
1
19
19
3
2
19
28
3
3
11
28
3
4
11
38
2
0
1
1
2
3
2
3
4
0
19
z(t) = x(t) + y(t)
11
0
1
4
0
3
1
4
1
1
1
5
0
3
3
5
1
3
7
6
0
2
1
6
1
0
3
7
0
3
11
7
1
1
3
7
0
3
14
8
0
2
3
8
1
1
3
9
17
5
4
3
0
0
13
1
1
4
13
3
2
4
19
3
3
9
19
2
0
1
1
2
2
3
5
3
0
0
27
1
1
4
27
3
2
4
21
3
3
9
21
2
0
1
2
1
2
3
6
1
0
13
20
1
1
22
20
2
0
1
7
5
0
0
11
1
1
11
11
3
2
11
17
2
3
2
11
3
4
0
25
1
5
2
25
3
0
3
1
2
3
1
4
5
3
5
8
4
0
11
23
1
1
11
27
3
2
16
27
3
3
16
18
3
4
22
18
2
0
1
1
2
3
2
3
4
0
19
z(t) = x(t) - y(t)
11
0
1
4
0
3
1
4
1
1
1
5
0
3
3
5
1
3
7
6
0
2
1
6
1
0
3
7
0
3
11
7
1
1
3
7
0
3
14
8
0
2
3
8
1
1
3
9
17
5
4
3
0
0
13
1
1
4
13
3
2
4
19
3
3
9
19
2
0
1
1
2
2
3
5
3
0
0
27
1
1
4
27
3
2
4
21
3
3
9
21
2
0
1
2
1
2
3
6
1
0
13
20
1
1
22
20
2
0
1
7
5
0
0
11
1
1
11
11
3
2
11
17
2
3
2
11
3
4
0
25
1
5
2
25
3
0
3
1
2
3
1
4
5
3
5
8
4
0
11
23
1
1
11
27
3
2
16
27
3
3
16
18
3
4
22
18
2
0
1
1
2
3
2
3
4
0
49
z(t) = k * x(t), where k = instance information
12
0
1
4
0
3
3
4
1
3
7
5
0
2
1
5
1
1
7
6
0
3
1
6
1
0
3
7
0
1
11
7
1
1
14
8
0
3
11
8
1
3
14
9
0
2
3
9
1
2
1
3
8
3
9
17
6
4
3
0
0
20
1
1
4
20
3
2
4
21
3
3
9
21
2
0
1
1
2
2
3
5
1
0
13
20
1
1
22
20
2
0
1
6
3
0
7
11
1
1
8
11
3
2
8
19
3
3
9
19
2
0
1
1
2
2
3
7
4
0
0
18
1
1
2
18
3
2
2
5
3
3
5
5
3
4
5
8
2
0
1
2
1
2
3
3
4
8
3
0
5
14
1
1
5
15
3
2
11
15
3
3
11
17
2
0
1
1
2
2
3
9
4
0
11
23
1
1
11
26
3
2
16
26
3
3
16
18
3
4
22
18
2
0
1
1
2
3
2
3
4
0
13
z(t) = -x(t)
8
0
1
3
0
1
2
3
1
1
7
4
0
2
1
4
1
0
3
5
0
1
11
5
1
1
14
6
0
2
3
6
1
1
1
9
17
4
3
1
0
0
20
1
1
9
20
2
0
1
4
1
0
13
20
1
1
22
20
2
0
1
5
4
0
0
18
1
1
5
18
3
2
5
13
3
3
11
13
3
4
11
17
2
0
1
2
1
2
3
3
4
6
4
0
11
23
1
1
11
27
3
2
16
27
3
3
16
18
3
4
22
18
2
0
1
1
2
3
2
3
4
0
54
z(t) = x(t-1)
NOTE: time is measured in clock ticks.
14
0
1
6
0
5
2
6
1
3
7
4
0
1
2
4
1
5
7
8
0
2
1
8
1
0
3
7
0
3
11
7
1
3
14
9
0
1
11
9
1
1
14
11
0
5
11
11
1
5
14
12
0
2
3
12
1
3
1
10
8
3
3
8
5
10
22
7
4
1
0
7
11
1
1
10
11
2
0
1
6
3
0
0
20
1
1
5
20
3
2
5
25
3
3
10
25
2
0
1
1
2
2
3
7
4
0
0
18
1
1
2
18
3
2
2
5
3
3
5
5
3
4
5
8
2
0
1
2
1
2
3
3
4
8
3
0
14
25
1
1
18
25
3
2
18
20
3
3
22
20
2
0
1
2
1
2
3
9
5
0
5
14
1
1
5
17
3
2
9
17
3
3
9
5
3
4
12
5
3
5
12
8
2
0
1
1
2
3
2
3
4
4
5
11
1
0
12
14
1
1
12
22
2
0
1
12
4
0
12
28
1
1
12
31
3
2
17
31
3
3
17
18
3
4
22
18
2
0
1
1
2
3
2
3
4
0
73
z(t) = 0 for t < 0
= k for t ≥ 0, where k = instance information
6
1
7
3
0
0
1
3
1
2
14
4
0
1
11
4
1
1
14
5
0
0
3
5
1
2
1
9
17
2
9
8
3
3
1
0
13
20
1
1
22
20
2
0
1
4
1
0
11
14
1
1
11
17
2
0
1
5
4
0
11
23
1
1
11
27
3
2
16
27
3
3
16
18
3
4
22
18
2
0
1
1
2
3
2
3
4
0
131
z(t) = 0 for t < 0
= k for t = 0, where k = instance information
= k + ∫x(r)dr for t > 0, where r runs from 0+ to t
18
6
7
7
0
5
2
7
1
3
7
8
0
2
1
8
1
1
3
8
1
0
1
9
0
1
1
9
1
1
7
8
0
4
14
10
0
6
11
10
1
3
11
10
1
3
14
11
0
2
3
11
1
6
14
12
0
5
11
12
1
5
14
12
0
1
11
12
1
1
14
11
0
5
1
8
22
3
15
10
4
1
1
5
8
10
6
1
10
6
7
1
0
5
13
1
1
8
13
2
0
1
8
9
0
19
13
1
1
20
13
3
2
20
20
3
3
22
20
2
4
20
32
3
5
6
32
3
6
6
26
3
7
8
26
2
8
20
25
3
9
12
25
1
0
1
1
2
2
3
2
8
5
4
6
5
6
7
8
4
9
8
9
3
0
0
20
1
1
4
20
3
2
4
24
3
3
8
24
2
0
1
1
2
2
3
10
4
0
3
7
1
1
3
10
2
2
3
8
3
3
17
8
3
4
17
10
2
0
2
2
1
2
3
3
4
11
5
0
17
16
1
1
17
18
3
2
22
18
2
3
10
28
1
4
10
30
3
5
17
30
3
0
1
1
2
3
4
4
5
1
5
12
8
0
3
16
1
1
3
18
3
2
7
18
3
3
7
9
3
4
10
9
3
5
10
10
2
6
10
16
1
7
10
18
3
8
10
22
2
0
1
1
2
3
2
3
4
4
5
6
7
2
7
7
8
0
76
z(t) = (x(t) + z(t-1) + z(t-2)) / 3
NOTE: time is measured in clock ticks.
14
4
7
9
0
5
2
9
1
0
2
6
0
3
3
6
1
3
1
9
1
5
7
7
0
8
7
12
0
1
1
7
1
3
7
10
0
1
3
10
1
1
7
11
0
8
2
11
1
2
2
12
1
4
2
12
1
5
1
13
16
3
5
17
4
2
4
5
10
4
8
15
27
6
6
3
0
0
19
1
1
2
19
3
2
2
21
3
3
5
21
2
0
1
1
2
2
3
7
5
0
14
7
1
1
16
7
3
2
16
12
3
3
12
12
3
4
12
18
3
5
13
18
2
0
1
1
2
3
2
3
4
4
5
9
6
0
6
7
1
1
10
7
2
2
8
7
3
3
8
13
3
4
4
13
3
5
4
19
3
6
5
19
2
0
2
2
1
2
3
4
3
4
5
5
6
10
1
0
9
20
1
1
13
20
2
0
1
11
5
0
17
19
1
1
18
19
3
2
18
24
3
3
14
24
3
4
14
30
3
5
15
30
2
0
1
1
2
3
2
3
4
4
5
12
7
0
19
30
1
1
21
30
3
2
21
19
3
3
22
19
2
4
21
2
3
5
1
2
3
6
1
7
3
7
2
7
2
0
1
2
1
2
3
4
2
5
4
5
6
6
7
0
203
z(t) = x(t) if x(t) ≤ |delta(t)| or x(t) ≥ |delta(t)|
= -|delta(t)| if -|delta(t)| < x < |delta(t)| and z(t-1) < 0
= +|delta(t)| if -|delta(t)| < x < |delta(t)| and z(t-1) ≥ 0
11
0
1
3
0
1
1
3
1
5
1
4
0
1
3
4
1
1
7
6
0
2
1
6
1
0
3
7
0
1
11
7
1
5
3
7
0
1
14
8
0
2
3
8
1
1
1
9
17
5
3
3
0
0
13
1
1
4
13
3
2
4
19
3
3
9
19
2
0
1
1
2
2
3
4
3
0
0
27
1
1
4
27
3
2
4
21
3
3
9
21
2
0
1
2
1
2
3
6
1
0
13
20
1
1
22
20
2
0
1
7
5
0
0
11
1
1
11
11
3
2
11
17
2
3
2
11
3
4
0
25
1
5
2
25
3
0
3
1
2
3
1
4
5
3
5
8
4
0
11
23
1
1
11
27
3
2
16
27
3
3
16
18
3
4
22
18
2
0
1
1
2
3
2
3
4
0
182
When “start” is poked, values are read from “x” and ”y”. Then:
• If “x” > “y” then “greater” is poked.
• If “x” = “y” then “equal” is poked.
• If “x” < “y” then “less” is poked.
16
4
2
8
0
6
1
8
1
5
2
9
0
6
3
9
1
6
7
10
0
7
2
10
1
0
2
11
0
6
11
11
1
6
14
12
0
7
11
12
1
7
13
13
0
1
2
13
1
7
14
14
0
2
2
14
1
7
15
15
0
3
2
15
1
2
6
4
16
7
12
16
8
8
3
0
0
12
1
1
2
12
3
2
2
18
3
3
4
18
2
0
1
1
2
2
3
9
3
0
0
26
1
1
2
26
3
2
2
20
3
3
4
20
2
0
1
2
1
2
3
10
1
0
8
19
1
1
12
19
2
0
1
11
3
0
11
0
1
1
11
8
3
2
6
8
3
3
6
16
2
0
1
2
1
2
3
12
5
0
6
22
1
1
6
24
3
2
10
24
3
3
10
12
3
4
14
12
3
5
14
16
2
0
1
1
2
3
2
3
4
4
5
13
3
0
13
22
1
1
13
30
3
2
4
30
3
3
4
38
2
0
1
2
1
2
3
14
3
0
14
22
1
1
14
31
3
2
11
31
3
3
11
38
2
0
1
2
1
2
3
15
3
0
15
22
1
1
15
30
3
2
18
30
3
3
18
38
2
0
1
1
2
2
3
0
200
Let “dt” be the instance information for this box; “dt” clock ticks following system initialization, “tick” is poked. Then “dt” clock ticks after that, “tick” is poked again, and so on ad infinitum.
8
4
7
2
0
3
2
2
1
3
14
7
0
1
2
7
1
4
14
6
0
3
11
6
1
4
11
7
1
0
14
7
0
3
0
3
6
3
12
16
4
3
16
3
2
1
0
7
19
1
1
12
19
2
0
1
6
5
0
5
22
1
1
5
26
3
2
9
26
3
3
9
12
3
4
14
12
3
5
14
16
2
0
1
1
2
3
2
3
4
4
5
7
8
0
14
22
1
1
14
30
3
2
11
30
3
3
11
38
2
4
1
30
3
5
1
14
3
6
5
14
3
7
5
16
2
8
5
12
1
0
1
2
1
2
3
4
2
5
4
5
6
6
7
8
6
0
737
When “start” is poked, values are read from “x” and “delta”. Then:
• If x ≤ -|delta| or x ≥ |delta|, then x is written to “z”.
• If -|delta| < x < |delta|, then if the last value previously written to “z” was negative, then -|delta| is written to “z”, else |delta| is written to “z”. (The first time “start” is poked, nothing has been written to “z” yet, but for purposes of this case the last value written is treated as non-negative.)
Finally, “done” is poked.
In short, this box makes sure it never outputs a value closer to zero than |delta|. Furthermore, it exhibits hysteresis in avoiding zero, so small oscillations in input (i.e., small compared to |delta|) will not cause the output value to oscillate between ±|delta|.